Ext.onReady(function() {

			// key:id value:mc
			var mc = new Ext.util.MixedCollection(false);

			var org = {
				orgId	: 1,
				name	: 'Microsoft'
			};

			var org2 = {
				orgId	: 2,
				name	: 'Apple'
			};

			var emp = {
				empId	: 1,
				name	: 'emp',
				age		: 24,
				sex		: 1
			};

			var emp2 = {
				empId	: 2,
				name	: 'emp2',
				age		: 30,
				sex		: 0
			};

			var emp3 = {
				empId	: 3,
				name	: 'emp3',
				age		: 24,
				sex		: 1
			};

			var emp4 = {
				empId	: 4,
				name	: 'emp4',
				age		: 30,
				sex		: 0
			};

			var emp5 = {
				empId	: 5,
				name	: 'emp5',
				age		: 30,
				sex		: 0
			};

			// key:id value:object
			var empMC = new Ext.util.MixedCollection(false, function(o) {
						return o.empId;
					});
			empMC.add(emp);
			empMC.add(emp2);

			var empMC2 = new Ext.util.MixedCollection(false, function(o) {
						return o.empId;
					});
			empMC2.add(emp4);
			empMC2.add(emp3);

			// empMC2.removeKey(4);
			// empMC2.keySort('ASC');

			empMC.replace(1, emp5);

			mc.add(org.orgId, empMC);
			mc.add(org2.orgId, empMC2);

			var detailMC = mc.get(1);
			var detailMC2 = mc.get(2);
			print(detailMC);
			print(detailMC2);

			function print(o) {
				o.each(function(i, idx) {
							alert(i.name);
						});
			}

			// -----------------------------------------

			var o = {
				age		: 15,
				name	: 'a',
				grade	: 85
			};
			var o2 = {
				age		: 15,
				name	: 'b',
				grade	: 70
			};
			var o4 = {
				age		: 16,
				name	: 'c',
				grade	: 60
			};
			var o5 = {
				age		: 17,
				name	: 'a',
				grade	: 55
			};
			var o3 = {
				age		: 15,
				name	: 'c',
				grade	: 90
			};
			var o6 = {
				age		: 17,
				name	: 'c',
				grade	: 75
			}

			var arr = [o, o2, o4, o5, o3, o6];

			function grouping(arr, prop) {
				var collection = new Ext.util.MixedCollection();
				Ext.each(arr, function(item, idx) {
							var propVal = prop(item, idx);
							var val = collection.get(propVal);
							if (val == undefined) {
								var arr = [];
								arr.push(item);
								collection.add(propVal, arr);
							} else {
								val.push(item);
								collection.add(propVal, val);
							}
						})

				return collection;
			}

			var result = grouping(arr, function(item) {
						return item['name'];
					});

			// Ext.encode(result.get('c') + ' ' + result.get(1)); 

			/*
			  function grouping(arr, prop) {
				var collection = new Ext.util.MixedCollection();
				Ext.each(arr, function(item) {
							var key = item[prop];
							var val = collection.get(key);
							if (val == undefined) {
								var arr = [];
								arr.push(item);
								collection.add(key, arr);
							} else {
								val.push(item);
								collection.add(key, val);
							}
						});

				return collection;
			}
			 var collection = grouping(arr, 'age')
			*/

			var total = 0;
			Ext.each(collection.get(15), function(item) {
						total += item.grade;
					})
			alert(total)

		});